<!--预警详情-->
<template>
    <div class="warnInfo">
        <div class="demo-tabs">
            <el-tabs v-model="state.tabsVal" @tab-click="handleClick">
                <el-tab-pane label="已处理" name="handle"></el-tab-pane>
                <el-tab-pane label="未处理" name="notHandle"></el-tab-pane>
            </el-tabs>
            <el-select v-model="state.selectVal" class="m-2">
                <el-option v-for="item in state.selectData" :key="item.value" :label="item.label" :value="item.value" />
            </el-select>
        </div>

        <div class="warnInfo_content">
            <el-scrollbar max-height="380px" height="380px">
                <CustomSafetySpyModalWarningTemplate :list-data="state.warnData"></CustomSafetySpyModalWarningTemplate>
            </el-scrollbar>

            <el-pagination
                v-model:currentPage="currentPage1"
                class="customPageClass"
                :page-size="1"
                small
                :background="true"
                :total="10"
            ></el-pagination>
        </div>
    </div>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue';
import type { TabsPaneContext } from 'element-plus';

const currentPage1 = ref(1);
const emit = defineEmits(['hiden']);
const state = reactive({
    warnData: [
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        },
        {
            list: [
                { name: '压力', value: 1.5 },
                { name: '事件类型', value: '超高报' },
                { name: '风险级别', value: '潜在风险' },
                { name: '触发时间', value: '2022-06-10 10:00:00' }
            ],
            tip: '未完成'
        }
    ],
    tabsVal: 'handle',
    selectVal: '安监',
    selectData: [
        {
            value: '安监',
            label: '安监'
        },
        {
            value: '总览',
            label: '总览'
        }
    ]
});

const hide = () => {
    emit('hiden', false);
};
const handleClick = (tab: TabsPaneContext) => {
    console.log(tab, 'tab');
};
</script>
<style scoped lang="scss">
.customPageClass {
    margin-top: 10px;
}
.demo-tabs {
    margin-bottom: 10px;
    position: relative;
    .m-2 {
        position: absolute;
        right: 0;
        top: 0;
        width: 12%;
        ::v-deep(.select-trigger) {
            width: 100%;
        }
        ::v-deep(.el-input__inner) {
            color: rgba($color: #dfeef3, $alpha: 0.7);
            font-size: 12px;
        }
        ::v-deep(.el-input__wrapper) {
            background: rgba($color: #fff, $alpha: 0.12) !important;
            box-shadow: none;
        }
    }
    ::v-deep(.el-tabs__item) {
        color: #fff;
        font-size: 18px;
    }
    ::v-deep(.is-active) {
        color: #0e96ff;
    }
    ::v-deep(.el-tabs__nav-wrap::after) {
        background: rgba($color: #0e96ff, $alpha: 0.28);
    }
    ::v-deep(.el-tabs__active-bar) {
        background: #0e96ff;
    }
}
.warnInfo {
    padding: 15px 30px 20px 30px;
    box-sizing: border-box;
    &_content {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        ::v-deep(.el-scrollbar) {
            width: 100%;
        }
        ::v-deep(.el-scrollbar__view) {
            display: flex;
            flex-wrap: wrap;
        }
        ::v-deep(.warnTemplate) {
            width: calc(50% - 12px);
            margin-right: 24px;
            &:last-of-type {
                margin-bottom: auto;
            }
            &:nth-of-type(2n) {
                margin-right: 0;
            }
        }
    }
}
</style>
